function [out,c] = target(x)
    global Ns dmax
    [alpha,delays,ts,Na,~,~] = general(x);
    T=sum(sum(ts,2).*alpha)/(dmax*sum(alpha));
    tDelay=sum(delays,'all')/(dmax*sum(alpha));
    out=sum(fillmissing([0.6*Na/Ns;0.2*tDelay;0.2*T],'constant',1));
    c=sum(sum(ts,2)>dmax);
end